<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>书店登录</title>
    <link rel="stylesheet" href="../css/index.css">
</head>

<body>
    <div class="body">
        <div class='box'>
            <div class='box1'>
                <span>图书销售管理系统</span>
            </div>
            <div class='box2'>
                <div>
                    <h3 class='title'>登录</h3>
                </div>
                <div class='message'>
                    <input type="search" id="username" name="username" required="required" placeholder="用户名"
                        autofocus="autofocus" autocomplete="on" />
                </div>
                <div class='message'>
                    <input type="password" id="password" name="password" required="required" placeholder="密码"
                        autofocus="autofocus" autocomplete="off" />
                </div>
                <div class="btn">
                    <button onclick="toUpdate()">登录</button>
                </div>
            </div>
        </div>
    </div>
</body>
<script>
    function toUpdate() {
        //转到更新页面;
        var username = document.getElementById("username").value;
        var userPsd = document.getElementById("password").value;
        if(username&&userPsd){
            location.replace("user.html");
            window.sessionStorage.setItem('username', username);
            window.sessionStorage.setItem('password', userPsd);
        }else{
            alert('请输入用户名或密码！')
        }
    }
</script>

</html>